sp              :=  $(sp).x
dirstack_$(sp)  :=  $(d)
d               :=  $(dir)

#  component specification
LIBRARY := $(OBJ_DIR)/libadvanceDetect.a

ADVANCEDETECT_OBJS = $(OBJ_DIR)/ad_process.o

OBJS_$(d)  :=  $(ADVANCEDETECT_OBJS)

ADVANCEDETECT_CFLAGS_LOCAL := -I$(TOP)/opendpi/src/include -I$(d) -I$(TOP)/api -I$(TOP)/opendpi/src/examples/OpenDPI_demo -I$(TOP)/opendpi/src/lib

$(OBJS_$(d)):  CFLAGS_LOCAL := $(ADVANCEDETECT_CFLAGS_LOCAL) -fPIC

#  standard component Makefile footer
DEPS_$(d)   :=  $(OBJS_$(d):.o=.d)

LIBS_LIST   :=  $(LIBS_LIST) $(LIBRARY)
OBJS := $(OBJS) $(OBJS_$(d))

CLEAN_LIST := $(CLEAN_LIST)
CLEAN_LIST += $(OBJS_$(d))
CLEAN_LIST += $(DEPS_$(d))
CLEAN_LIST += $(LIBRARY) *~

-include $(DEPS_$(d))

$(LIBRARY): $(OBJS_$(d))
	rm -f $@
	$(AR) -cr $@ $^

$(OBJ_DIR)/%.o: $(d)/%.c
	$(COMPILE)

d   :=  $(dirstack_$(sp))
sp  :=  $(basename $(sp))
